package com.java.util;

/**
 * @desc
 * @author zhengzy
 * @version 2016年5月21日
 */
public class Test {
	public static void main(String[] args) throws Exception {
		String inputStr = "DES";
		String key = DESCoder.initKey();
		key = "rg4Zkg5ej08=";
		System.err.println("原文:\t" + inputStr);
		System.err.println("密钥:\t" + key);
		byte[] inputData = inputStr.getBytes();
		inputData = DESCoder.encrypt(inputData, key);
		System.err.println("加密后:\t" + DESCoder.encryptBASE64(inputData));
		byte[] outputData = DESCoder.decrypt(DESCoder.decryptBASE64(DESCoder.encryptBASE64(inputData)), key);
		String outputStr = new String(outputData);
		System.err.println("解密后:\t" + outputStr);

	}
}
